home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / idl / nsISelectElement.idl < prev    next >
Text File  |  2006-05-08  |  5KB  |  127 lines

  1. /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* ***** BEGIN LICENSE BLOCK *****
  3.  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  4.  *
  5.  * The contents of this file are subject to the Mozilla Public License Version
  6.  * 1.1 (the "License"); you may not use this file except in compliance with
  7.  * the License. You may obtain a copy of the License at
  8.  * http://www.mozilla.org/MPL/
  9.  *
  10.  * Software distributed under the License is distributed on an "AS IS" basis,
  11.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  12.  * for the specific language governing rights and limitations under the
  13.  * License.
  14.  *
  15.  * The Original Code is mozilla.org code.
  16.  *
  17.  * The Initial Developer of the Original Code is
  18.  * Netscape Communications Corporation.
  19.  * Portions created by the Initial Developer are Copyright (C) 1998
  20.  * the Initial Developer. All Rights Reserved.
  21.  *
  22.  * Contributor(s):
  23.  *
  24.  * Alternatively, the contents of this file may be used under the terms of
  25.  * either of the GNU General Public License Version 2 or later (the "GPL"),
  26.  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  27.  * in which case the provisions of the GPL or the LGPL are applicable instead
  28.  * of those above. If you wish to allow use of your version of this file only
  29.  * under the terms of either the GPL or the LGPL, and not to allow others to
  30.  * use your version of this file under the terms of the MPL, indicate your
  31.  * decision by deleting the provisions above and replace them with the notice
  32.  * and other provisions required by the GPL or the LGPL. If you do not delete
  33.  * the provisions above, a recipient may use your version of this file under
  34.  * the terms of any one of the MPL, the GPL or the LGPL.
  35.  *
  36.  * ***** END LICENSE BLOCK ***** */
  37.  
  38. #include "nsISupports.idl"
  39.  
  40. interface nsIContent;
  41. interface nsIDOMHTMLOptionElement;
  42. interface nsPresContext;
  43.  
  44. /** 
  45.  * This interface is used to notify a SELECT when OPTION
  46.  * elements are added and removed from its subtree.
  47.  * Note that the nsIDOMHTMLSelectElement and nsIContent 
  48.  * interfaces are the ones to use to access and enumerate
  49.  * OPTIONs within a SELECT element.
  50.  */
  51.  
  52. [scriptable, uuid(35bd8ed5-5f34-4126-8c4f-38ba01681836)]
  53. interface nsISelectElement : nsISupports
  54. {
  55.  
  56.   /**
  57.    * To be called when stuff is added under a child of the select--but *before*
  58.    * they are actually added.
  59.    *
  60.    * @param aOptions the content that was added (usually just an option, but
  61.    *        could be an optgroup node with many child options)
  62.    * @param aParent the parent the options were added to (could be an optgroup)
  63.    * @param aContentIndex the index where the options are being added within the
  64.    *        parent (if the parent is an optgroup, the index within the optgroup)
  65.    */
  66.   [noscript] void willAddOptions(in nsIContent aOptions,
  67.                                  in nsIContent aParent,
  68.                                  in long aContentIndex);
  69.  
  70.   /**
  71.    * To be called when stuff is removed under a child of the select--but
  72.    * *before* they are actually removed.
  73.    *
  74.    * @param aParent the parent the option(s) are being removed from
  75.    * @param aContentIndex the index of the option(s) within the parent (if the
  76.    *        parent is an optgroup, the index within the optgroup)
  77.    */
  78.   [noscript] void willRemoveOptions(in nsIContent aParent,
  79.                                     in long aContentIndex);
  80.  
  81.   /**
  82.    * Checks whether an option is disabled (even if it's part of an optgroup)
  83.    *
  84.    * @param aIndex the index of the option to check
  85.    * @return whether the option is disabled
  86.    */
  87.   boolean isOptionDisabled(in long aIndex);
  88.  
  89.   /**
  90.    * Sets multiple options (or just sets startIndex if select is single)
  91.    * and handles notifications and cleanup and everything under the sun.
  92.    * When this method exits, the select will be in a consistent state.  i.e.
  93.    * if you set the last option to false, it will select an option anyway.
  94.    *
  95.    * @param aStartIndex the first index to set
  96.    * @param aEndIndex the last index to set (set same as first index for one
  97.    *        option)
  98.    * @param aIsSelected whether to set the option(s) to true or false
  99.    * @param aClearAll whether to clear all other options (for example, if you
  100.    *        are normal-clicking on the current option)
  101.    * @param aSetDisabled whether it is permissible to set disabled options
  102.    *        (for JavaScript)
  103.    * @param aNotify whether to notify frames and such
  104.    * @return whether any options were actually changed
  105.    */
  106.   boolean setOptionsSelectedByIndex(in long aStartIndex,
  107.                                     in long aEndIndex,
  108.                                     in boolean aIsSelected,
  109.                                     in boolean aClearAll,
  110.                                     in boolean aSetDisabled,
  111.                                     in boolean aNotify);
  112.  
  113.   /**
  114.    * Finds the index of a given option element
  115.    *
  116.    * @param aOption the option to get the index of
  117.    * @param aStartIndex the index to start looking at
  118.    * @param aForward TRUE to look forward, FALSE to look backward
  119.    * @return the option index
  120.    */
  121.   long getOptionIndex(in nsIDOMHTMLOptionElement aOption,
  122.                       in long aStartIndex, in boolean aForward);
  123.  
  124.   /** Whether or not there are optgroups in this select */
  125.   readonly attribute boolean hasOptGroups;
  126. };
  127.